{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[[ 67.38322    -1.9517338]\n",
      " [-11.936052   -8.906425 ]\n",
      " [-12.751774   22.038895 ]\n",
      " ...\n",
      " [-10.278599    8.832907 ]\n",
      " [ 25.714725   11.745557 ]\n",
      " [ -1.93841    16.851025 ]]\n"
     ]
    }
   ],
   "source": [
    "from sklearn.manifold import TSNE\n",
    "from sklearn.datasets import load_digits\n",
    "\n",
    "\n",
    "data = load_digits()\n",
    "n_components = 2 # 设置降维后的维度为2\n",
    "model = TSNE(n_components=n_components)\n",
    "print(model.fit_transform(data.data))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.8.3"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
